package com.starbucks.opencase.controller;

import com.starbucks.opencase.dao.daoAdminAccount;
import com.starbucks.opencase.request.reqAdminCreateAccount;
import com.starbucks.opencase.request.reqAdminLogin;
import com.starbucks.opencase.request.reqSendCode;
import com.starbucks.opencase.response.resAdminLogin;
import com.starbucks.opencase.response.resSendCode;
import com.starbucks.opencase.response.resStatus;
import com.starbucks.opencase.service.serAdminAccount;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/admin")
public class conAdminAccount implements daoAdminAccount{
    @Autowired
    private serAdminAccount serAdminAccount;
    @Override
    @PostMapping("/send/code")
    public resSendCode sendCode(@RequestBody reqSendCode info) {
        return serAdminAccount.sendCode(info);
    }

    @Override
    @PostMapping("/login")
    public resAdminLogin login(@RequestBody reqAdminLogin info) {
        return serAdminAccount.login(info);
    }

    @Override
    @PostMapping("/create")
    public resStatus create(@RequestBody reqAdminCreateAccount info) {
        return serAdminAccount.create(info);
    }
}
